package com.zzy.product.feign;

import com.zzy.utils.to.SkuReductionTo;
import com.zzy.utils.to.SpuBoundTo;
import com.zzy.utils.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Author kazu
 * @Date 2023/2/9 19:11
 * @Version 1.0
 */
@SuppressWarnings({"all"})
@FeignClient("gulimall-coupon")
public interface CouponFeignService {
	
	/**
	 * 1、couponFeignService.saveSpuBounds(spuBoundTo);
	 * 		1）、@RequestBody将这个对象转换成json
	 * 		2）、找到gulimall-coupon服务，给/coupon/spubounds/save发送请求
	 * 		3）、对方服务收到请求，请求体里面有json数据
	 * 			（@RequestBody SpuBoundTo spuBoundTo）：将请求体的json转为（@RequestBody SpuBoundsEntity spuBounds）
	 * 只要json数据模型是兼容的，双方服务不要求使用同一个to
	 * @param spuBoundTo
	 */
	@PostMapping("/coupon/spubounds/save")
	public R saveSpuBounds(@RequestBody SpuBoundTo spuBoundTo);
	
	/**
	 *
	 * @param skuReductionTo
	 * @return
	 */
	@PostMapping("/coupon/skufullreduction/saveinfo")
	public R saveSkuReduction(@RequestBody SkuReductionTo skuReductionTo);
}







